package com.yang.booking.service;

import com.yang.booking.dao.RegionMapper;
import com.yang.booking.pojo.Region;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class RegionService {

    @Autowired
    private RegionMapper regionMapper;

    public Map<String, Object> insertRegion(String name){

        Region region = new Region();
        region.setName(name);
        region.setCreateAt(new Date());
        region.setUpdateAt(new Date());
        regionMapper.insert(region);

        Map<String, Object> msg = new HashMap<String, Object>();
        msg.put("massage", "插入成功");
        msg.put("code", 200);
        return msg;
    }
}
